class AccidentFormModel extends Backbone.Model
    url: '/mytable/getModel?s=table.creators.AccidentTable'
    initialize: (options) =>
        @fetch()
   
#--------------------------------------------------controler
class AccidentsApp
    search: =>
        myapp.mainRegion.close() 
        mymodel = new AccidentFormModel
        @layout = new ModelMainLayout(model: mymodel)
        myapp.mainRegion.show(@layout)

            

#--------------------------------------------------router
class AccidentsAppRouter extends Backbone.Marionette.AppRouter
    appRoutes: 
        "accidents": "search"

                
myapp.addInitializer -> 
    myapp.Accidents_app = new AccidentsApp()
    myapp.Accidents_app.router = new AccidentsAppRouter controller: myapp.Accidents_app

myapp.vent.trigger("routing:started")
